//package com.plian.system.controller.dj;
//
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
//import com.baomidou.mybatisplus.core.metadata.IPage;
//import com.plian.Tools.Func;
//import com.plian.Tools.StringPool;
//import com.plian.Tools.base.BaseController;
//import com.plian.system.config.Resubmit;
//import com.plian.system.entity.dj.DjPartyOrganizationMap;
//import com.plian.system.model.CommonCode;
//import com.plian.system.model.ListResult;
//import com.plian.system.model.R;
//import com.plian.system.mybatis.search.SearchEntity;
//import com.plian.system.mybatis.search.SearchParamEntiy;
//import com.plian.system.mybatis.search.TokenSearch;
//import com.plian.system.mybatis.support.Condition;
//import com.plian.system.mybatis.support.Query;
//import com.plian.system.service.dj.IDjPartyOrganizationMapService;
//import com.plian.system.vo.dj.DjPartyOrganizationMapVO;
//import com.plian.system.wrapper.dj.DjPartyOrganizationMapWrapper;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import io.swagger.annotations.ApiResponse;
//import io.swagger.annotations.ApiResponses;
//import lombok.AllArgsConstructor;
//import org.apache.commons.lang3.StringUtils;
//import org.springframework.transaction.annotation.Transactional;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import javax.validation.Valid;
//import java.util.List;
//
///**
// * 国资党建-党建组织地图管理
// **/
//@RestController
//@AllArgsConstructor
//@RequestMapping("api/party_org_map")
//@Api(value = "国资党建-党建组织地图管理", tags = "国资党建-党建组织地图管理")
//public class DjPartyOrganizationMapController extends BaseController {
//
//    private final IDjPartyOrganizationMapService partyOrganizationMapService;
//
//    private final DjPartyOrganizationMapWrapper partyOrganizationMapWrapper;
//
//
//    /**
//     * 新增或修改
//     */
//    @ApiOperation(value = "新增或修改", notes = "新增或修改")
//    @ApiResponses({
//            @ApiResponse(code = 200, message = "操作成功"),
//            @ApiResponse(code = 500, message = "服务器错误"),
//    })
//
//    @PostMapping("/submit")
//    @Resubmit(delaySeconds = 0)
//    public R submit(@Valid @RequestBody DjPartyOrganizationMap partyOrganizationMap) {
//        return R.status(partyOrganizationMapService.submit(partyOrganizationMap));
//    }
//
//
//    /**
//     * 查询详情
//     */
//    @ApiOperation(value = "查询详情", notes = "查询详情")
//    @ApiResponses({
//            @ApiResponse(code = 200, message = "操作成功"),
//            @ApiResponse(code = 500, message = "服务器错误"),
//    })
//    @PostMapping("/detail")
//    public R<DjPartyOrganizationMapVO> detail(@RequestBody DjPartyOrganizationMap partyOrganizationMap) {
//        DjPartyOrganizationMap detail = partyOrganizationMapService.getOne(Condition.getQueryWrapper(partyOrganizationMap));
//        return R.data(partyOrganizationMapWrapper.entityToVO(detail));
//    }
//
//    /**
//     * 列表分页
//     */
//    @ApiOperation(value = "列表分页", notes = "列表分页")
//    @ApiResponses({
//            @ApiResponse(code = 200, message = "操作成功"),
//            @ApiResponse(code = 500, message = "服务器错误"),
//    })
//    @PostMapping("/list")
//    public ListResult<DjPartyOrganizationMapVO> list(@RequestBody Query query) {
//        List<SearchEntity> entityList = query.getSearch();
//        if (query.getAscs() == null && query.getDescs() == null) {
//            query.setDescs("create_time");
//        }
//        QueryWrapper<DjPartyOrganizationMap> queryWrapper = SearchParamEntiy.getQueryWrapper(
//                Condition.getQueryWrapper(new DjPartyOrganizationMap()), entityList
//        );
//        TokenSearch<DjPartyOrganizationMap> tokenSearch = new TokenSearch<>();
//		tokenSearch.addTokenQuery(queryWrapper, query);
//        IPage<DjPartyOrganizationMap> pages = partyOrganizationMapService.page(Condition.getPage(query), queryWrapper);
//        ListResult<DjPartyOrganizationMapVO> listResult = new ListResult<>(CommonCode.SUCCESS);
//        listResult.setList(partyOrganizationMapWrapper.entityToVO(pages.getRecords()));
//        listResult.setTotal(Long.valueOf(pages.getTotal()).intValue());
//        return listResult;
//    }
//
//    /**
//     * 删除
//     */
//    @ApiOperation(value = "删除", notes = "删除")
//    @ApiResponses({
//            @ApiResponse(code = 200, message = "操作成功"),
//            @ApiResponse(code = 500, message = "服务器错误"),
//    })
//    @Transactional(rollbackFor = Throwable.class)
//    @PostMapping("/submit")
//    public R remove(@RequestBody DjPartyOrganizationMapVO partyOrganizationMapVO) {
//        List<Long> ids = partyOrganizationMapVO.getIds();
//        return R.status(partyOrganizationMapService.deleteLogic(Func.toLongList(StringUtils.join(ids, StringPool.COMMA))));
//    }
//
//
//}
